package api

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

var OkResp = func(c *gin.Context, data string) {
	c.JSON(http.StatusOK, gin.H{
		"code":   200,
		"result": "ok",
		"data":   data,
	})
}

var ErrResp = func(c *gin.Context, err error) {
	c.JSON(http.StatusOK, gin.H{
		"code":   400,
		"result": err.Error(),
	})
}
